package com.head.firtst.ch2.demo2;

import java.util.Observable;

/**
 * @author guohuixin
 * @date 2018/8/11
 */
public class WeatherData extends Observable{
    private float temp;
    private float humidity;
    private float pressure;

    private void measurementsChanged(){
        setChanged();
        notifyObservers();
    }

    public void setMeasureMents(float temp, float humidity, float pressure) {
        this.temp = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        measurementsChanged();
    }

    public float getTemp() {
        return temp;
    }

    public void setTemp(float temp) {
        this.temp = temp;
    }

    public float getHumidity() {
        return humidity;
    }

    public void setHumidity(float humidity) {
        this.humidity = humidity;
    }

    public float getPressure() {
        return pressure;
    }

    public void setPressure(float pressure) {
        this.pressure = pressure;
    }
}
